package service;

import dao.DeptDao;
import entity.DeptEntity;
import org.apache.ibatis.session.SqlSession;
import util.SqlSessionFactoryUtil;

import java.util.List;

public class DeptServiceImpl {

    public List<DeptEntity> getAll() {
        try (SqlSession session = SqlSessionFactoryUtil.getSession()) {
            DeptDao mapper = session.getMapper(DeptDao.class);
            return mapper.getAll();
        }
    }
}
